package edu.gdkm.factory;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Component

public class ToyFactory2 {
    static long no= 100000000000l;
    @Bean(name="iso-toy2")
    @Scope("prototype")

    public Toy createToy(@Value("toy2") String name){
        System.out.println("toy2生产一个玩具:"+name);
        return new Toy("km-"+name,"ISO"+(no++));
    }
}
